import { createStore } from 'vuex'

export default createStore({
  state: {
    age: 1
  },
  mutations: {
    addAge(state) {
      return state.age++
    },
    cutAge(state, sum) {
      return state.age = sum
    }
  },
  actions: {
    asaddAge(context) {
      context.commit('addAge')
    },
    ascutAge({ commit }, sum) {
      commit('cutAge', sum)
    }
  },
  modules: {
  }
})
